<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${ctx}/statics/js/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
	$(function() {
		$('#test').click(function() {
			$.post('${ctx}/login', $('form').serialize(), function(data) {
				console.info('ff');
				$('#test').html(data);
			});
		});
	});
</script>
</head>
<body>
	${SPRING_SECURITY_LAST_EXCEPTION}
	<a id="test" href="#">测试</a>
<!-- 	<img src="captcha" /> -->
	<form action="login" method="post">
		<input type="text" name="captcha" value="12" />用户名： <input type="text" name="username" />密码： <input type="text" name="password" /> <input type="hidden" name="${_csrf.parameterName}"
			value="${_csrf.token}" /> <input type="submit" value="确定">
	</form>
</body>
</html>